﻿using System;

namespace WillsLLC.DbGen.Text.Inflection
{
    [Serializable]
    internal struct Pronoun
    {
        public Pronoun(String data)
            : this(data.Split(new Char[] { ' ' }, StringSplitOptions.None)) { }

        public Pronoun(String[] data)
        {
            _singular = data[0];
            _plural = data[1];
            _pronounType = data[2];
        }
        private String _singular;
        private String _plural;
        private String _pronounType;

        internal String Singular { get { return _singular; } }
        internal String Plural { get { return _plural; } }
        internal String PronounType { get { return _pronounType; } }

        public String GetPlural(String singular)
        {
            if (InflectionUtility.GetWordPattern(this._singular).IsMatch(singular)) return this._plural;            
            else return null;
        }
    }
}